<?php $this->headTitle($this->__('Profile') . ' » ', Zend_View_Helper_Placeholder_Container_Abstract::PREPEND);?>

<style type="text/css">
.errors {
    color: #f00;
}
</style>
<script type="text/javascript">
//<![CDATA[
    $(function(){
        var el = $('<a id="showPassword" href="javascript:void(0)">').click(function(){
            var $this  = $(this);
            var $field = $this.prev();
            var $clone = $field.clone();

                if ($this.attr('type') == 'password') {
                    $clone.attr('type', 'text');
                } else {
                    $clone.attr('type', 'password');
                }
                $clone.insertAfter(this);
                $this.remove();
                form.init();
            });
        });
        $("#accordion").accordion({
            collapsible: true,
            change: function(event, ui) {
                var $el = form.find('.password');
                form.makeClean($el);
                $el.attr('disabled', $el.is(':hidden'));

            $('#crudForm').aForm();
        }).text('Show');

        $('#password').after(el);

        var el = $('<a id="showOldPassword" href="javascript:void(0)">').click(function(){
            var $this  = $(this);
            var $field = $this.prev();
            var $clone = $field.clone();

            if ($field.attr('type') == 'password') {
                $clone.attr('type', 'text');
                $this.text('Hide');
            } else {
                $clone.attr('type', 'password');
                $this.text('Show');
            }
            $clone.insertBefore(this);
            $field.remove();

            $('#crudForm').aForm();
        }).text('Show');

        $('#oldPassword').after(el);
    });
//]]>
</script>
<?php $this->form->setAction($this->url());?>

<?php echo $this->aForm($this->form)->ajax(
    array('validateUrl' => $this->url(array('id' => $this->request('id')), 'users-profile-validate'))
)?>